# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

set(BENCHMARK_DEPENDENCIES
    pollux_functions_test_lib
    pollux_exec
    pollux_exec_test_lib
    Melon::melon
    Melon::melonbenchmark)

add_executable(pollux_benchmark_call_null_free_no_nulls
               CallNullFreeBenchmark.cpp)
target_link_libraries(
  pollux_benchmark_call_null_free_no_nulls ${BENCHMARK_DEPENDENCIES})
target_compile_definitions(
  pollux_benchmark_call_null_free_no_nulls PUBLIC WITH_NULL_ARRAYS=false
                                                 WITH_NULL_ELEMENTS=false)

add_executable(pollux_benchmark_call_null_free_null_arrays
               CallNullFreeBenchmark.cpp)
target_link_libraries(
  pollux_benchmark_call_null_free_null_arrays ${BENCHMARK_DEPENDENCIES})
target_compile_definitions(
  pollux_benchmark_call_null_free_null_arrays PUBLIC WITH_NULL_ARRAYS=true
                                                    WITH_NULL_ELEMENTS=false)

add_executable(pollux_benchmark_call_null_free_null_elements
               CallNullFreeBenchmark.cpp)
target_link_libraries(
  pollux_benchmark_call_null_free_null_elements ${BENCHMARK_DEPENDENCIES})
target_compile_definitions(
  pollux_benchmark_call_null_free_null_elements PUBLIC WITH_NULL_ARRAYS=false
                                                      WITH_NULL_ELEMENTS=true)

add_executable(pollux_benchmark_call_null_free_null_arrays_and_null_elements
               CallNullFreeBenchmark.cpp)
target_link_libraries(
  pollux_benchmark_call_null_free_null_arrays_and_null_elements
  ${BENCHMARK_DEPENDENCIES})
target_compile_definitions(
  pollux_benchmark_call_null_free_null_arrays_and_null_elements
  PUBLIC WITH_NULL_ARRAYS=true WITH_NULL_ELEMENTS=true)

add_executable(pollux_benchmark_variadic VariadicBenchmark.cpp)
target_link_libraries(
  pollux_benchmark_variadic ${BENCHMARK_DEPENDENCIES})
